{% extends 'layout.html' %}
    {% load static %}
    {% block css %}
            <link rel="stylesheet" href="{% static 'plugins/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css' %}">
    {% endblock %}
    {% block content %}
        <div class="container">
            <div class="panel panel-default">
              <div class="panel-heading">
                <h3 class="panel-title">新建用户</h3>
              </div>
              <div class="panel-body">
                <form method="post" novalidate>
                    {% csrf_token %}
                    {% for field in form %}
                        <div class="form-group">
                            <label>{{ field.label }}</label>
                            {{ field }}
                            <span style="color:red;">{{ field.errors.0 }}</span>
                        </div>
                    {% endfor %}

                    <button type="submit" class="btn btn-primary">提 交</button>
                </form>
              </div>
            </div>
        </div>
    {% endblock %}

    {% block js %}
        <script src="% static 'plugins/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js' %"></script>
        <script src="% static 'plugins/bootstrap-datepicker/dist/locales/bootstrap-datepicker.zh-CN.min.js' %"></script>
        <script type="text/javascript">
            $(document).ready(function () {
                $('#id_create_time').datepicker({
                    format: 'yyyy-mm-dd', <!--设置日期格式-->
                    autoclose: true, <!-- 选择日期后自动关闭日期选择器-->
                    todayHighlight: true, <!--高亮今天-->
                    defaultViewDate: { year: 2023, month: 4, day: 1 } <!-- 设置默认视图日期为2023年5月1日-->
                });

                <!-- 设置输入框的默认日期-->
                $('#datepicker').datepicker('setDate', '2024-10-01');
            });
        </script>
    {% endblock %}


